// 静态路由：登录页、404、默认布局等
import type { RouteRecordRaw } from "vue-router";
import Layout from "@/layouts/index.vue";
import InformationDetail from '@/views/information-detail/index.vue';

export const layoutRouter: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Root",
    redirect: "/home/index",
    meta: { hidden: true },
  },
  {
    path: "/home",
    name: "Home",
    component: Layout,
    redirect: "/home/index",
    meta: { title: "首页", icon: "HomeFilled" },
    children: [
      {
        path: "index",
        name: "HomeIndex",
        component: () => import("@/views/home/index.vue"),
        meta: { title: "首页", icon: "HomeFilled" },
      },
      {
        path: "inforManage",
        name: "InforManage",
        component: () => import("@/views/home/inforManage.vue"),
        meta: { title: "资讯管理", icon: "HomeFilled" },
      },
    ],
  },
  {
    path: "/auth/login",
    name: "Login",
    component: () => import("@/views/auth/login.vue"),
    meta: {
      isDefaultChat: true,
      icon: "HomeFilled",
      hidden: true,
    },
  },
  {
    path: '/InformationDetail-detail/:module',
    name: 'InformationDetail',
    component: InformationDetail,
    // meta: { title: "首页", icon: "HomeFilled" },
  },
];

export const staticRouter: RouteRecordRaw[] = [];

export const errorRouter: RouteRecordRaw[] = [
  {
    path: "/403",
    name: "Forbidden",
    component: () => import("@/views/error/403.vue"),
    meta: {
      title: "403页面",
      hidden: true,
    },
  },
  {
    path: "/404",
    name: "NotFound",
    component: () => import("@/views/error/404.vue"),
    meta: {
      title: "404页面",
      hidden: true,
    },
  },
  {
    path: "/:pathMatch(.*)*",
    name: "NotFoundCatchAll",
    component: () => import("@/views/error/404.vue"),
    meta: { hidden: true },
  },
];